home *** CD-ROM | disk | FTP | other *** search
- %BEGIN ReoundRectangles
- /ovWidth 0 def
- /ovHeight 0 def
- /ovSize
- {
- /ovHeight exch def
- /ovWidth exch def
- }
- def
- /buildRRpath
- {
- /rightCoord exch def
- /bottomCoord exch def
- /leftCoord exch def
- /topCoord exch def
- /startmatrix matrix currentmatrix def
- ovHeight 0 le
- { /halfheight .0001 def }
- {
- ovHeight bottomCoord topCoord sub gt
- {/halfheight bottomCoord topCoord sub 2 div def}
- {/halfheight ovHeight 2 div def}
- ifelse
- }
- ifelse
- ovWidth 0 le
- { /halfwidth .0001 def }
- {
- ovWidth rightCoord leftCoord sub gt
- {/halfwidth rightCoord leftCoord sub 2 div def}
- {/halfwidth ovWidth 2 div def}
- ifelse
- }
- ifelse
- halfwidth halfheight gt
- {
- /unscale halfwidth halfheight div def
- 1 halfheight halfwidth div scale
- /radius halfwidth def
- /newleft leftCoord def
- /newright rightCoord def
- /newtop topCoord unscale mul def
- /newbottom bottomCoord unscale mul def
- }
- {
- /unscale halfheight halfwidth div def
- halfwidth halfheight div 1 scale
- /radius halfheight def
- /newleft leftCoord unscale mul def
- /newright rightCoord unscale mul def
- /newtop topCoord def
- /newbottom bottomCoord def
- }
- ifelse
- newleft halfwidth add newtop moveto
- newright newtop newright newbottom radius arct
- newright newbottom newleft newbottom radius arct
- newleft newbottom newleft newtop radius arct
- newleft newtop newright newtop radius arct
- closepath
- startmatrix setmatrix
- }
- def
- /roundrectpath
- {
- /lastright exch def
- /lastbottom exch def
- /lastleft exch def
- /lasttop exch def
- newpath
- lasttop lastleft lastbottom lastright buildRRpath
- }
- def
- /frameRRect
- {
- /lastright exch def
- /lastbottom exch def
- /lastleft exch def
- /lasttop exch def
- penWidth 0 gt
- penHeight 0 gt
- and
- {
- gsave
- penPattern usePattern
- newpath
- penWidth 1 eq
- penHeight 1 eq
- and
- {
- lasttop lastleft lastbottom 1 sub lastright 1 sub buildRRpath
- stroke
- }
- {
- lasttop lastleft lastbottom lastright buildRRpath
- save
- /ovHeight ovHeight penHeight 2 mul sub def
- /ovWidth ovWidth penWidth 2 mul sub def
- lasttop penHeight add
- lastleft penWidth add
- lastbottom penHeight sub
- lastright penWidth sub
- buildRRpath
- eofill
- restore
- }
- ifelse
- grestore
- }
- if
- } def
- /paintRRect
- {
- gsave
- penPattern usePattern
- roundrectpath
- fill
- grestore
- }
- def
- /eraseRRect
- {
- gsave
- backPattern usePattern
- roundrectpath
- fill
- grestore
- }
- def
- /invertRRect
- {
- gsave
- roundrectpath
- grestore
- } def
- /fillRRect
- {
- gsave
- fillPattern usePattern
- roundrectpath
- fill
- grestore
- } def
- /frameSameRRect
- { lasttop lastleft lastbottom lastright frameRRect }
- def
- /paintSameRRect
- { lasttop lastleft lastbottom lastright paintRRect }
- def
- /eraseSameRRect
- { lasttop lastleft lastbottom lastright eraseRRect }
- def
- /invertSameRRect
- { lasttop lastleft lastbottom lastright invertRRect }
- def
- /fillSameRRect
- { lasttop lastleft lastbottom lastright fillRRect }
- def
- %END RoundRectangles
-